<%@ page import="org.apache.struts2.ServletActionContext" %>
<%@ page import="com.zzc.bean.Employee" %>
<%@ page import="java.util.List" %>
<%@ page language="java" contentType="text/html; charset=utf-8"
         pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://"
            + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <title>Insert title here</title>
  <script type="text/javascript" src="<%=path%>/assets/js/jquery-1.7.2.js"></script>
  <script type="text/javascript" src="<%=path%>/assets/js/employee_opration.js"></script>
    <link href="<%=path%>/assets/bootstrap/css/bootstrap.css" rel="stylesheet" />
</head>
<body>
<%
  List<Employee> list_employees = (List<Employee>) request.getAttribute("list_employees");
%>
<div align="center">
    <table class="table table-hover table table-striped">
    <tr>
      <td>ID</td>
      <td>Num. del usuario</td>
      <td>Nom. del usuario</td>
      <td>Contraseña</td>
      <td>Nom. de empresa</td>
      <td>Notas</td>
      <td>Creador</td>
      <td>Editor</td>
      <td>Operación</td>
    </tr>
    <tbody id="tb">
    <%
      if(list_employees!=null&&list_employees.size()>0)
      {
        for(int i=0;i<list_employees.size();i++)
        {
          Employee employee = list_employees.get(i);
    %>
      <tr id="tr_<%=employee.getEmployee_account()%>">
        <td><%=employee.getEmployee_id()%></td>
        <td><%=employee.getEmployee_account() %></td>
        <td><%=employee.getEmployee_name() %></td>
        <td><%=employee.getEmployee_password() %></td>
        <td><%=employee.getEmployee_company() %></td>
        <td><%=employee.getEmployee_note() %></td>
        <td><%=employee.getEmployee_founder() %></td>
        <td><%=employee.getEmployee_modifier() %></td>
        <td>
          <a href="<%=path%>/Action/Action_EmployeeAction_alter_get_account?employee_account=<%=employee.getEmployee_account()%>"> <button>Modificación</button></a>
          <button onclick="onClick_employee_delete_account(this,'<%=path%>')">Eliminación</button>
        </td>
      </tr>
    <%
        }
      }
    %>
    </tbody>
  </table>
  <a href="<%=path%>/view/employee/employee_add.jsp"> <button>Usuarios nuevos</button></a>
</div>
</body>
</html>